#!/usr/bin/env python
__author__ = "Ingmar Krusch"
__email__ = "krusch@immobilienscout24.de"
import sys

class Input:
	"""reads the raw RPM dependencies from eighter cmd line args OR stdin"""
	def __init__(self):
		self.rawDependencies = []

	def __optionallyReplaceMinusSignWithDependenciesReadFromStdin(self, args):
		for index, item in enumerate(args):
			if (item == "-"):
				args[index] = sys.stdin.read()
		return args

	def optionallyHandleStdin(self, rawDependencies):
		if (len(rawDependencies) > 0):
			self.rawDependencies = self.__optionallyReplaceMinusSignWithDependenciesReadFromStdin(rawDependencies)
		else:
			self.rawDependencies = [sys.stdin.read()]

	def __repr__(self):
		return repr(self.rawDependencies)